package com.touchstone.synchdata.common.util.vo;

/**
 * @Description: 连接服务返回结果封装
 * @Author: hunter
 * @Date:2019-09-03 13:49
 */
public class SdkTokenVO {

    /**
     * 成功状态码
     */
    private static final int SUCCESS_CODE = 0;
    /**
     * 失败错误码
     */
    private static final int FAIL_CODE = 1;
    /**
     * 信息提示
     */
    private static final String SUCCESS_MSG = "操作成功";
    private static final String FAIL_MSG = "操作失败";

    /**
     * 返回码
     */
    private Integer recode;
    /**
     * 说明
     */
    private String remsg;

    /**
     * token
     */
    private String token;

    public SdkTokenVO() {
    }

    public SdkTokenVO(Integer recode, String remsg) {
        this.recode = recode;
        this.remsg = remsg;
    }

    public SdkTokenVO(Integer recode, String remsg, String token) {
        this.recode = recode;
        this.remsg = remsg;
        this.token = token;
    }

    public static SdkTokenVO success(String msg){
        return new SdkTokenVO(SUCCESS_CODE, msg);
    }

    public static SdkTokenVO successToken(String token){
        return new SdkTokenVO(SUCCESS_CODE, SUCCESS_MSG, token);
    }

    public static SdkTokenVO fail(String msg){
        return new SdkTokenVO(FAIL_CODE, msg);
    }

    public static SdkTokenVO fail(){
        return new SdkTokenVO(FAIL_CODE, FAIL_MSG);
    }

    public Integer getRecode() {
        return recode;
    }

    public void setRecode(Integer recode) {
        this.recode = recode;
    }

    public String getRemsg() {
        return remsg;
    }

    public void setRemsg(String remsg) {
        this.remsg = remsg;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }
}
